/*
 * @Description: 内存分配与释放，释放完内存，并不会置为NULL
 * @Version: 1.0
 * @Author: marshal
 * @Date: 2022-06-11 18:18:05
 * @LastEditors: marshal
 * @LastEditTime: 2023-09-07 08:39:00
 */
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int main(int argc, char const *argv[])
{
    char * str;
    str = (char*)malloc(10 * sizeof(char));
    strcpy(str,"hello str");
    printf("str = %s\n", str); //  hello str
    printf("address of str = %p\n", str); // address of str = 0x558d9b9142a0
    free(str);
    printf("str = %s\n", str);
    printf("address of str = %p\n", str); // address of str = 0x558d9b9142a0
    return 0;
}
